import { defineStore } from "pinia";
import { ref } from "vue";
export const useStore = defineStore(
  "counter",
  () => {
    const img = ref("");
    const title = ref("");
    function changeImg(val: string) {
      img.value = val;
    }
    function changeTitle(val: string) {
      title.value = val;
    }
    const goods=ref()
    function setGoods(val:any){
      goods.value=val
    }
    const swiperImg = ref('')
    function changeSwiperImg(val: string) {
      swiperImg.value = val;
    }
    return {
      img,
      changeImg,
      title,
      changeTitle,
      goods,
      setGoods,
      swiperImg,
      changeSwiperImg,
    };
  },
  {
    persist: true, //开启本地存储
  }
);
